/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rcnss.ui.form;

import com.rcnss.data.Reclamation;
import com.rcnss.ui.application.main.MainApp;
import com.rcnss.ui.form.field.factory.ReclamationFieldFactory;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;

/**
 *
 * @author Guesmi
 */
public class NewReclamationForm extends AbstractForm {
    private Reclamation rec = new Reclamation();

    public NewReclamationForm(boolean Edit)
    {
        HorizontalLayout h = new HorizontalLayout();
        h.setSizeFull();
        h.setMargin(true);
        Panel p = new Panel();
        p.setSizeFull();
        
        rec.setUTL_ID(MainApp.UserSessionData.ConnectedUserID);
        EditForm r = new EditForm(rec, new ReclamationFieldFactory(Edit));
        UploadForm u = new UploadForm();
        r.setCaption("Nouvelle Reclamation");
        r.setStyleName("form");
        h.addComponent(r);
        //r.setWidth("50em");
        h.addComponent(u);
        h.setComponentAlignment(u, Alignment.MIDDLE_RIGHT);
        h.setExpandRatio(r, 4);
        h.setExpandRatio(u, 2);
        p.addComponent(h);
        this.root.addComponent(p);
        this.root.setComponentAlignment(p, Alignment.MIDDLE_CENTER);
    }
}
